// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdSequence
 */
public class AdSequenceDaoImpl
    extends org.tinaelle.server.domain.AdSequenceDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdSequenceDao#toAdSequenceDTO(org.tinaelle.server.domain.AdSequence)
     */
    public org.tinaelle.common.dto.AdSequenceDTO toAdSequenceDTO(final org.tinaelle.server.domain.AdSequence entity)
    {
        return super.toAdSequenceDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdSequence loadAdSequenceFromAdSequenceDTO(org.tinaelle.common.dto.AdSequenceDTO adSequenceDTO)
    {
        org.tinaelle.server.domain.AdSequence adSequence = this.load(adSequenceDTO.getAdSequenceId());
        if (adSequence == null)
        {
            adSequence = org.tinaelle.server.domain.AdSequence.Factory.newInstance();
        }
        return adSequence;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdSequenceDao#adSequenceDTOToEntity(org.tinaelle.common.dto.AdSequenceDTO)
     */
    public org.tinaelle.server.domain.AdSequence adSequenceDTOToEntity(org.tinaelle.common.dto.AdSequenceDTO adSequenceDTO)
    {
        org.tinaelle.server.domain.AdSequence entity = this.loadAdSequenceFromAdSequenceDTO(adSequenceDTO);
        this.adSequenceDTOToEntity(adSequenceDTO, entity, true);
        return entity;
    }
}